<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view(TPL_FOLDER."header");?>
<script type="text/javascript" src="{root_path}js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<script type="text/javascript" src="{root_path}js/jquery/jquery.colorPicker-1.0.1.js"></script>
<table width="100%" border="0" cellpadding="5" cellspacing="0" >
  <tr>
    <td width="3%" align="left" ><img src="{tpl_path}images/forward.jpg" /></td>
    <td width="97%" align="left" >您现在的位置：<a href="<?php echo site_url(CTL_FOLDER."news");?>">文章列表</a> &gt; 添加文章 </td>
  </tr>
</table>
  <div id="TabAdd" style="display:none">
    <ul>
      <li><a href="#TabAdd-1"><span>基本信息</span></a></li>
      <li><a href="#TabAdd-2"><span>文章内容</span></a></li>
    </ul>
    <form  action="<?php echo site_url(CTL_FOLDER."news/add_record");?>" method="post" enctype="multipart/form-data" name="dialog_add_form" id="dialog_add_form">
      <div id="TabAdd-1">
        <table width="100%"  border="0" cellpadding="3" cellspacing="0" >
          <tr>
            <td width="133"><font color="#FF0000">*</font>文章分类：</td>
            <td width="592"><select name="catalog_id" id="catalog_id">
                <option value=",0,">==根目录==</option>
                <?php foreach($catalog_list as $row) {?>
                <option value="<?php echo $row->queue;?>"><?php echo str_repeat("&nbsp;&nbsp;",$row->deep_id).$row->cat_name;?></option>
                <?php }?>
              </select>&nbsp;&nbsp;<input type="checkbox" name="is_trash" value="1" /> 放入回收站
            </td>
          </tr>
          <tr>
            <td width="133"><font color="#FF0000">*</font>文章标题：</td>
            <td width="592"><input Name="title" type="text" Id="title" size="50" dataType="Require" msg="该项必须填写">&nbsp; <input type="hidden" name="title_color" id="title_color" /><img style="cursor:pointer" src="{tpl_path}images/color.gif"  align="absmiddle" onclick="$(this).colorPicker({ setValue:'input[name=title_color]' ,setBackground:true })" title="标题颜色" />
            </td>
          </tr>
          <tr>
          <td width="133">meta关键词：</td>
          <td width="592"><input type="text" name="keyword" maxlength="255" size="50"  /></td>
        </tr>
         <tr>
          <td>meta描述：</td>
          <td><textarea name="description" cols="50" rows="5"></textarea></td>
        </tr>
        <tr>
            <td>摘要：</td>
            <td><textarea name="summary" id="summary" cols="50" rows="5" dataType="Limit" require="false" max="250" msg="字数不超过250"></textarea></td>
          </tr>
          <tr>
            <td width="133">作者：</td>
            <td width="592"><input Name="author" type="text" Id="author" size="10" maxlength="50" value="admin">
            </td>
          </tr>
          <tr>
            <td width="133">来源：</td>
            <td width="592"><input Name="source" type="text" Id="source" value="未知" size="10" maxlength="50">
            </td>
          </tr>
          <tr>
            <td width="133"><font color="#FF0000">* </font>发布日期：</td>
            <td><input name="create_date" onClick="WdatePicker({'dateFmt':'yyyy-MM-dd HH:mm:ss'})" type="text" id="create_date" value="<?php echo date("Y-m-d H:i:s",time());?>" >
            </td>
          </tr>
          <tr>
            <td>上传图片：</td>
            <td>
            <input type="text" name="pic_path" id="pic_path" size="25" /> <input name="pic" type="file" id="pic" size="15" dataType="Filter" accept="<?php echo str_replace("|",",",UP_IMAGES_EXT);?>" require="false" msg="文件格式必须是：<?php echo UP_IMAGES_EXT;?>" title="上传的文件格式必须是：<?php echo UP_IMAGES_EXT;?>,且单个文件不能超过 <?php echo ini_get("upload_max_filesize");?>">  <input type="button" name="sfbtn" class="button-style2" onclick="GetFileDialog('pic_path')" value="选择文件" />
            </td>
          </tr>
           <tr>
        <td><font color="#FF0000">*</font>排序号：</td>
        <td><input name="seqorder" type="text" id="seqorder" size="4" value="0" datatype="Integer" msg="该项必须填写数字" />
        </td>
      </tr>
        </table>
      </div>
      <div id="TabAdd-2"> <?php echo $content->create();?> </div>
       <input type="button" name="sbmit" style=" margin-left:160px; margin-bottom:10px; margin-top:10px" onclick="subForm(this.form,this)" value="添加" class="button-style" />
    </form>
  </div>
<script language="javascript">
$(document).ready(function(){
	$("#TabAdd").tabs();
	$("#TabAdd").show();
}); 
</script>
<?php $this->load->view(TPL_FOLDER."footer");?>